package com.gameplatform.common.response;

import com.gameplatform.common.enums.ResultCodeEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = true)
public class ListResponse<T> extends BaseResponse<List<T>> {
    private long total;

    public ListResponse(ResultCodeEnum resultCode, List<T> data, long total) {
        super(resultCode, data);
        this.total = total;
    }

    public ListResponse(ResultCodeEnum resultCode, String message, List<T> data, long total) {
        super(resultCode, message, data);
        this.total = total;
    }

    public static <T> ListResponse<T> success(List<T> data) {
        return new ListResponse<>(ResultCodeEnum.SUCCESS, data, data.size());
    }

    public static <T> ListResponse<T> success(List<T> data, long total) {
        return new ListResponse<>(ResultCodeEnum.SUCCESS, data, total);
    }

    public static <T> ListResponse<T> success(List<T> data, long total, String message) {
        return new ListResponse<>(ResultCodeEnum.SUCCESS, message, data, total);
    }
} 